package com.sgb.kjwl.model.entity.transport;

import android.text.TextUtils;

import com.sgb.kjwl.utils.NumberUtil;
import com.swgk.core.util.DateUtils;

import java.util.List;

/**
 * @author: 杨畔
 * @date: 4/15/21 12:10 PM
 * @Description: 司机工作台数据
 */
public class DriverWorkbenchEntity {
    /**
     * destCityName : 成都
     * districtName : 武侯
     * freight : 999.0
     * destProvinceName : 四川
     * bargain : null
     * destDistrictName : 武侯
     * messageStatus : 1
     * cityName : 成都
     * carrierNo : 1382619490143047680
     * shipmentEndTime : 1619798399000
     * provinceName : 四川
     * carrierId : 1334
     * shipmentStartTime : 1618416000000
     */

    private LatelyCarrierBean latelyCarrier;
    /**
     * latelyCarrier : {"destCityName":"成都","districtName":"武侯","freight":999,"destProvinceName":"四川","bargain":null,"destDistrictName":"武侯","messageStatus":1,"cityName":"成都","carrierNo":"1382619490143047680","shipmentEndTime":1619798399000,"provinceName":"四川","carrierId":1334,"shipmentStartTime":1618416000000}
     * messageList : [{"sourceId":3663,"messagePrice":12,"destCityName":"天津","districtName":"东城","freight":1245,"userNo":"1344204592484847616","pattern":0,"weight":25,"destProvinceName":"天津","sourceNo":"1376424564803899392","updateTime":1617000163651,"content":"货主蒲小天刚发布了从北京-北京-东城->天津-天津河东重25.00吨null普通货源，运费1245.00，信息费12.0","destDistrictName":"河东","volume":null,"cityName":"北京","goodsModeName":"","shipmentEndTime":null,"provinceName":"北京","state":null,"shipmentStartTime":null},{"sourceId":2101,"messagePrice":50,"destCityName":"北京市","districtName":"东城区","freight":300,"userNo":"202009274306262","pattern":0,"weight":20,"destProvinceName":"北京市","sourceNo":"202012157457422","updateTime":1616646409109,"content":"货主蒲涛刚发布了从北京市-北京市-东城区->北京市-北京市西城区重20.00吨null普通货源，运费300.00，信息费50.0","destDistrictName":"西城区","volume":null,"cityName":"北京市","goodsModeName":"","shipmentEndTime":null,"provinceName":"北京市","state":null,"shipmentStartTime":null}]
     * count : 0
     */

    private int count;
    /**
     * sourceId : 3663
     * messagePrice : 12.0
     * destCityName : 天津
     * districtName : 东城
     * freight : 1245.0
     * userNo : 1344204592484847616
     * pattern : 0
     * weight : 25.0
     * destProvinceName : 天津
     * sourceNo : 1376424564803899392
     * updateTime : 1617000163651
     * content : 货主蒲小天刚发布了从北京-北京-东城->天津-天津河东重25.00吨null普通货源，运费1245.00，信息费12.0
     * destDistrictName : 河东
     * volume : null
     * cityName : 北京
     * goodsModeName :
     * shipmentEndTime : null
     * provinceName : 北京
     * state : null
     * shipmentStartTime : null
     */

    private List<MessageListBean> messageList;

    public LatelyCarrierBean getLatelyCarrier() {
        return latelyCarrier;
    }

    public void setLatelyCarrier(LatelyCarrierBean latelyCarrier) {
        this.latelyCarrier = latelyCarrier;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public List<MessageListBean> getMessageList() {
        return messageList;
    }

    public void setMessageList(List<MessageListBean> messageList) {
        this.messageList = messageList;
    }

    public static class LatelyCarrierBean {
        private String destCityName;
        private String districtName;
        private String freight;
        private String destProvinceName;
        //是否可议价  0 不可议价  1 可议价
        private Integer bargain;
        private String destDistrictName;
        //信息状态 1正常 2失效
        private Integer messageStatus;
        private String cityName;
        private String carrierNo;
        private Long shipmentEndTime;
        private String provinceName;
        private String carrierId;
        private Long shipmentStartTime;
        private Integer freightUnit;

        public String getDestCityName() {
            return destCityName;
        }

        public void setDestCityName(String destCityName) {
            this.destCityName = destCityName;
        }

        public String getDistrictName() {
            return districtName;
        }

        public void setDistrictName(String districtName) {
            this.districtName = districtName;
        }

        public String getFreight() {
            if (TextUtils.isEmpty(freight)) {
                return "";
            }
            return NumberUtil.trim0(freight);
        }

        public void setFreight(String freight) {
            this.freight = freight;
        }

        public String getDestProvinceName() {
            return destProvinceName;
        }

        public void setDestProvinceName(String destProvinceName) {
            this.destProvinceName = destProvinceName;
        }

        public Integer getBargain() {
            return bargain;
        }

        public void setBargain(Integer bargain) {
            this.bargain = bargain;
        }

        public String getDestDistrictName() {
            return destDistrictName;
        }

        public void setDestDistrictName(String destDistrictName) {
            this.destDistrictName = destDistrictName;
        }

        public Integer getMessageStatus() {
            return messageStatus;
        }

        public void setMessageStatus(Integer messageStatus) {
            this.messageStatus = messageStatus;
        }

        public String getCityName() {
            return cityName;
        }

        public void setCityName(String cityName) {
            this.cityName = cityName;
        }

        public String getCarrierNo() {
            return carrierNo;
        }

        public void setCarrierNo(String carrierNo) {
            this.carrierNo = carrierNo;
        }

        public String getProvinceName() {
            return provinceName;
        }

        public void setProvinceName(String provinceName) {
            this.provinceName = provinceName;
        }

        public String getCarrierId() {
            return carrierId;
        }

        public void setCarrierId(String carrierId) {
            this.carrierId = carrierId;
        }

        public Long getShipmentStartTime() {
            return shipmentStartTime;
        }

        public void setShipmentStartTime(Long shipmentStartTime) {
            this.shipmentStartTime = shipmentStartTime;
        }

        public Long getShipmentEndTime() {
            return shipmentEndTime;
        }

        public void setShipmentEndTime(Long shipmentEndTime) {
            this.shipmentEndTime = shipmentEndTime;
        }

        public String getShipmentTimeStr() {
            String startTime = DateUtils.stampToDay4(getShipmentStartTime());
            String endTime = DateUtils.stampToDay4(getShipmentEndTime());
            if (startTime.equals(endTime)) {
                return startTime;
            } else {
                return startTime + "-" + endTime;
            }
        }

        public Integer getFreightUnit() {
            return freightUnit;
        }

        public void setFreightUnit(Integer freightUnit) {
            this.freightUnit = freightUnit;
        }

        public String getFreightUnitType() {
            String str = "";//*1：元/趟，2：元/吨，3：元/方
            if (freightUnit == null) {
                str = "元/吨";
                return str;
            }
            switch (freightUnit) {
                case 1:
                    str = "元/趟";
                    break;
                case 2:
                    str = "元/吨";
                    break;
                case 3:
                    str = "元/方";
                    break;
            }
            return str;
        }
    }

    public static class MessageListBean {
        private Integer sourceId;
        private Double messagePrice;
        private String destCityName;
        private String districtName;
        private Double freight;
        private String userNo;
        private Integer pattern;
        private Double weight;
        private String destProvinceName;
        private String sourceNo;
        private Long updateTime;
        private String content;
        private String destDistrictName;
        private Double volume;
        private String cityName;
        private String goodsModeName;
        private String secondGoodsTypeName;
        private Long shipmentEndTime;
        private String provinceName;
        private Integer state;
        private Long shipmentStartTime;


        public Integer getSourceId() {
            return sourceId;
        }

        public void setSourceId(Integer sourceId) {
            this.sourceId = sourceId;
        }

        public Double getMessagePrice() {
            return messagePrice;
        }

        public void setMessagePrice(Double messagePrice) {
            this.messagePrice = messagePrice;
        }

        public String getDestCityName() {
            return destCityName;
        }

        public void setDestCityName(String destCityName) {
            this.destCityName = destCityName;
        }

        public String getDistrictName() {
            return districtName;
        }

        public void setDistrictName(String districtName) {
            this.districtName = districtName;
        }

        public Double getFreight() {
            return freight;
        }

        public void setFreight(Double freight) {
            this.freight = freight;
        }

        public String getUserNo() {
            return userNo;
        }

        public void setUserNo(String userNo) {
            this.userNo = userNo;
        }

        public Integer getPattern() {
            return pattern;
        }

        public void setPattern(Integer pattern) {
            this.pattern = pattern;
        }

        public Double getWeight() {
            return weight;
        }

        public void setWeight(Double weight) {
            this.weight = weight;
        }

        public String getDestProvinceName() {
            return destProvinceName;
        }

        public void setDestProvinceName(String destProvinceName) {
            this.destProvinceName = destProvinceName;
        }

        public String getSourceNo() {
            return sourceNo;
        }

        public void setSourceNo(String sourceNo) {
            this.sourceNo = sourceNo;
        }

        public Long getUpdateTime() {
            return updateTime;
        }

        public void setUpdateTime(Long updateTime) {
            this.updateTime = updateTime;
        }

        public String getContent() {
            return content;
        }

        public void setContent(String content) {
            this.content = content;
        }

        public String getDestDistrictName() {
            return destDistrictName;
        }

        public void setDestDistrictName(String destDistrictName) {
            this.destDistrictName = destDistrictName;
        }

        public Double getVolume() {
            return volume;
        }

        public void setVolume(Double volume) {
            this.volume = volume;
        }

        public String getCityName() {
            return cityName;
        }

        public void setCityName(String cityName) {
            this.cityName = cityName;
        }

        public String getGoodsModeName() {
            return goodsModeName;
        }

        public void setGoodsModeName(String goodsModeName) {
            this.goodsModeName = goodsModeName;
        }

        public String getSecondGoodsTypeName() {
            return secondGoodsTypeName;
        }

        public void setSecondGoodsTypeName(String secondGoodsTypeName) {
            this.secondGoodsTypeName = secondGoodsTypeName;
        }

        public String getGoodsLastTypeName() {
            String name = "";
            if (!TextUtils.isEmpty(secondGoodsTypeName)) {
                name = secondGoodsTypeName;
            } else if (!TextUtils.isEmpty(goodsModeName)) {
                name = goodsModeName;
            }
            return name;
        }

        public Long getShipmentEndTime() {
            return shipmentEndTime;
        }

        public void setShipmentEndTime(Long shipmentEndTime) {
            this.shipmentEndTime = shipmentEndTime;
        }

        public String getProvinceName() {
            return provinceName;
        }

        public void setProvinceName(String provinceName) {
            this.provinceName = provinceName;
        }

        public Integer getState() {
            return state;
        }

        public void setState(Integer state) {
            this.state = state;
        }

        public Long getShipmentStartTime() {
            return shipmentStartTime;
        }

        public void setShipmentStartTime(Long shipmentStartTime) {
            this.shipmentStartTime = shipmentStartTime;
        }


    }
}
